package com.springboot.service.impl;

import com.springboot.mapper.MessageInformMapper;
import com.springboot.mapper.UserLoginFormMapper;
import com.springboot.model.MessageInform;
import com.springboot.model.UserLoginForm;
import com.springboot.service.DoctorUnreadMessageNumberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * 本业务用于医生查看自己的未读消息数量
 */
@Service
public class DoctorUnreadMessageNumberServiceImpl implements DoctorUnreadMessageNumberService {
    @Autowired
    private UserLoginFormMapper userLoginFormMapper;
    @Autowired
    private MessageInformMapper messageInformMapper;

    //通过手机号码查找用户
    @Override
    public UserLoginForm findUserByTel(String userTel)
    {
        UserLoginForm userLoginForm=userLoginFormMapper.selectByTel(userTel);
        return userLoginForm;
    }

    //通过医生id查找该医生的消息列表
    @Override
    public ArrayList<MessageInform> findMessageByDoctorId(Integer doctorId)
    {
        ArrayList<MessageInform> messageInforms=messageInformMapper.selectByDoctorId(doctorId);
        return messageInforms;
    }
}
